<template>
	<view class="login_bg">
		<view class="like_top">
			<view class="back" @click="my_dongtai()"><em><image src="../../static/images/left.png" mode="widthFix"></image></em></view>
			<view class="like">发动态</view>
		</view>
		<view class="send_dt">
			<textarea  v-model="message" auto-height=""  maxlength="200" placeholder="请在此输入动态" placeholder-style="font-size:0.8rem;color:#999;" style="height: 5rem;"></textarea>
			<view class="send_num">{{ characterCount }}/200</view>
		</view>
		<view class="container">
		    <input type="file" class="file-input"/>
			<view class="up_file"><image src="../../static/images/icon_add_album-937b9cff.png" mode="widthFix"></image></view>
		</view>
		<view class="kaiguan">
			<view><view class="kaiguan_yc">对用户隐藏</view></view>
			<view><switch :checked="isChecked" @change="handleSwitchChange" class="kg"/></view>
		</view>

		<view>
			<button class="btn">发布</button>
		</view>







	</view>
</template>

<script>
export default {
  data() {
    return {
      message: '',
	   isChecked: false
    };
  },
  computed: {
    characterCount() {
      return this.message.length;
    }
  },
  methods: {
	  
	  send_message(){
	  		  uni.navigateTo({
	  		  	url:'/pages/send_message/send_message'
	  		  })
	  },
	  my_dongtai(){
	  		  uni.navigateTo({
	  		  	url:'/pages/my_dongtai/my_dongtai'
	  		  })
	  },
	  
	  
	  
	  
	  
	  
      handleFileChange(event) {
        // 获取文件
        const file = event.target.files[0];
        // 可以在这里处理文件，比如预览等
      },
      uploadFile() {
        // 触发文件选择
        this.$refs.fileInput.click();
        // 实际的上传逻辑
        // ...
      },
	  
	  handleSwitchChange(event) {
	        this.isChecked = event.detail.value;
	        // 这里可以执行你的逻辑，比如保存开关状态到服务器等
	        console.log('Switch is ' + (this.isChecked ? 'on' : 'off'));
			}
	  
    }
};
</script>

<style>
  @import "../../static/css/send_message.css";
</style>
